package com.jzwl.site.wap.helpoverty.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.jzwl.common.upload.service.UploadImgService;
import com.jzwl.site.manager.contentv2.service.SiteContentV2Service;
import com.jzwl.site.wap.helpoverty.service.HelProverService;
import com.jzwl.system.base.controller.BaseController;

@Controller
@RequestMapping("/HelProver")
public class HelProverController  extends BaseController {
	
	@Autowired
	private HelProverService helProverService;
	@Autowired
	private UploadImgService uploadImgService;
	/**
	 * 跳转到添加前端首页
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/HelProverList")
	public ModelAndView toAddsiteContentV2(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		mov.addObject("coentenlist", coentenlist);
		mov.addObject("carouseList", carouseList);
		mov.addObject("operateList", operateList);
		mov.setViewName("/wap/helPoverty/helPoverIndex");
		return mov;
	}
	
	/**
	 * 跳转到大赛报名页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/enrolList")
	public ModelAndView enrol(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		mov.addObject("coentenlist", coentenlist);
		mov.addObject("carouseList", carouseList);
		mov.addObject("operateList", operateList);
		mov.setViewName("/wap/helPoverty/enrol");
		return mov;
	}
	
	/**
	 * 跳转到大赛概况页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/surveyList")
	public ModelAndView survey(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		mov.addObject("coentenlist", coentenlist);
		mov.addObject("carouseList", carouseList);
		mov.addObject("operateList", operateList);
		mov.setViewName("/wap/helPoverty/survey");
		return mov;
	}
	
	/**
	 * 跳转到大赛动态页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/trendsList")
	public ModelAndView trends(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> conTactList = helProverService.queryConTact(paramsMap);//联系方式
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		mov.addObject("coentenlist", coentenlist);
		mov.addObject("carouseList", carouseList);
		mov.addObject("conTactList", conTactList);
		mov.addObject("operateList", operateList);
		mov.setViewName("/wap/helPoverty/trends");
		return mov;
	}
	
	/**
	 * 跳转到大赛排名页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/rankingList")
	public ModelAndView ranking(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> conTactList = helProverService.queryConTact(paramsMap);//联系方式
		List<Map<String,Object>> rankListList = helProverService.queryrank(paramsMap);//排名
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表

		mov.addObject("coentenlist", coentenlist);//内容
		mov.addObject("carouseList", carouseList);//轮播图
		mov.addObject("conTactList", conTactList);//联系方式
		mov.addObject("rankListList", rankListList);//排名
		mov.addObject("operateList", operateList);//合作单位列表
		mov.setViewName("/wap/helPoverty/ranking");
		return mov;
	}
	
	/**
	 * 跳转到大赛动态详情页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/trendsdetails")
	public ModelAndView trendsdetails(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> conTactList = helProverService.queryConTact(paramsMap);//联系方式
		Map<String,Object> siteContentV2=helProverService.getByContenId(paramsMap);//文章详情
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		
		mov.addObject("coentenlist", coentenlist);//内容
		mov.addObject("carouseList", carouseList);//轮播图
		mov.addObject("conTactList", conTactList);//联系方式
		mov.addObject("siteContentV2", siteContentV2);//文章详情
		mov.addObject("operateList", operateList);//合作单位列表
		mov.setViewName("/wap/helPoverty/trends_details");
		return mov;
	}
	
	/**
	 * 跳转到大赛热点详情页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/trendshot")
	public ModelAndView trendshot(HttpServletRequest request, HttpServletResponse response) {
		
		ModelAndView mov = new ModelAndView();
		createParameterMap(request);
		List<Map<String,Object>> coentenlist = helProverService.queryGameSurvey(paramsMap);//内容列表
		List<Map<String,Object>> carouseList = helProverService.queryCarouse(paramsMap);//轮播图列表
		List<Map<String,Object>> conTactList = helProverService.queryConTact(paramsMap);//联系方式
		Map<String,Object> siteContentV2=helProverService.getByContenId(paramsMap);//文章详情
		List<Map<String,Object>> operateList = helProverService.operate(paramsMap);//合作单位列表
		
		mov.addObject("coentenlist", coentenlist);//内容
		mov.addObject("carouseList", carouseList);//轮播图
		mov.addObject("conTactList", conTactList);//联系方式
		mov.addObject("siteContentV2", siteContentV2);//文章详情
		mov.addObject("operateList", operateList);//合作单位列表
		mov.setViewName("/wap/helPoverty/trends_hot");
		return mov;
	}
}
